<template>
  <div class="container">
    <a-space direction="vertical" :size="16" fill>
      <DataOverview :renderData="memberTotal.data" title="会员统计" />
      <DataOverview :renderData="orderTotal.data" title="用户订单统计" />
      <!-- <DataOverview :renderData="bigOrderTotal.data" title="大批发订单统计" /> -->
      <DataOverview :renderData="storeTotal.data" title="商户统计" />
      <!-- <ContentPublishingSource /> -->
    </a-space>
  </div>
</template>

<script lang="ts" setup>
import DataOverview from './components/data-overview.vue'
// import ContentPublishingSource from './components/content-publishing-source.vue'
import { get } from '@/utils'
interface Data {
  title: string
  count: any
  prefix: {
    icon: string
    background: string
    iconColor: string
  }
}
/**会员统计 */
const memberTotal = reactive({
  data: [] as Data[],
  getData: () => {
    get({ url: '/server-base/admin/stats/user/count' }, ({ data }) => {
      data.map(v => {
        v.prefix = {
          background: '',
          icon: '',
          iconColor: '',
        }
      })
      memberTotal.data = data
    })
  },
})

memberTotal.getData()
/**用户订单统计 */
const orderTotal = reactive({
  data: [] as Data[],
  getData: () => {
    get({ url: '/server-base/admin/stats/order1/count' }, ({ data }) => {
      data.map(v => {
        v.prefix = {
          background: '',
          icon: '',
          iconColor: '',
        }
      })
      orderTotal.data = data
    })
  },
})

orderTotal.getData()
/**商户统计 */
const storeTotal = reactive({
  data: [] as Data[],
  getData: () => {
    get({ url: '/server-base/admin/stats/seller/count' }, ({ data }) => {
      data.map(v => {
        v.prefix = {
          background: '',
          icon: '',
          iconColor: '',
        }
      })
      storeTotal.data = data
    })
  },
})
storeTotal.getData()
</script>

<style scoped lang="less">
.container {
  padding: 0 20px 20px 20px;
}

:deep(.section-title) {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 16px;
}

:deep(.chart-wrap) {
  height: 264px;
}
</style>
